package com.haiya.singleton.lazyman.threadunsafe;

public class Singleton {
    private static Singleton singleton;

    private Singleton() {

    }

    /**
     *  当调用getInstance的时候才创建单例对象
     *  即 懒汉式(Lazy Man)
     */
    public static Singleton getInstance() {
        if (singleton == null) {
            singleton = new Singleton();
        }
        return singleton;
    }
}